package custom;

public class CustomRecursion {
    public static int factorial(int number) {
        if (number == 0) return 1;
        else return number * factorial(number - 1);
    }

    public static int fibonacciSequence(int number) {
        if (number == 1 || number == 2) return 1;
        else return fibonacciSequence(number - 2) + fibonacciSequence(number - 1);
    }

    public static int fibonacciSequence(int first, int second, int index) {
        if (index == 1) return first;
        else {
            /*System.out.println(first);*/
            return fibonacciSequence(second, first + second, index - 1);
        }
    }
}
